<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Title</title>

</head>
<body>
<form action="${pageContext.request.contextPath}/captcha/test1">
    <img id="cap" src="${pageContext.request.contextPath}/captcha" style="width:100px" onclick="refresh();">
    <input type="text" name="captcha"/>
    <br>
    <input type="submit" value="提交">
</form>

<script>
    function refresh(){
        var img = document.getElementById("cap");
        img.src="${pageContext.request.contextPath}/captcha?"+new Date().getTime()
    }
</script>

</body>
</html>
